package com.hzjy.common.utils;

import com.hzjy.common.config.WXpayConfig;

/**
 * 微信登录工具类
 * @author SS
 */
public class ApiUserUtils {
    //替换字符串
    public static String getCode(String APPID, String REDIRECT_URI, String SCOPE) {
        return String.format(ResourceUtil.getConfigByName("wx.getCode"), APPID, REDIRECT_URI, SCOPE);
    }

    //替换字符串
    public static String getWebAccess(String CODE) {
        return String.format(ResourceUtil.getConfigByName("wx.webAccessTokenhttps"),
                ResourceUtil.getConfigByName(WXpayConfig.APPID),
                ResourceUtil.getConfigByName(WXpayConfig.AppSecret),
                CODE);
    }

    //替换字符串
    public static String getUserMessage(String access_token, String openid) {
        return String.format(ResourceUtil.getConfigByName("wx.userMessage"), access_token, openid);
    }
    //获取二维码前缀
    public static String getQrcodePrefix(){
        return ResourceUtil.getConfigByName("wx.qrcodePrefix");
    }
}
